Carbon


ThreadOptions

Header: Threads.h

enum ThreadOptions {
    kNewSuspend = 1,
    kUsePremadeThread = 2,
    kCreateIfNeeded = 4,
    kFPUNotNeeded = 8,
    kExactMatchThread = 16
};

Constant descriptions

kNewSuspend

Begin a new thread in the stopped state.

kUsePremadeThread

Use a thread from the existing supply.

kCreateIfNeeded

Create a new thread if one with the proper style and stack size requirements does not exist.

kFPUNotNeeded

Do not save the FPU context. This saves time when switching contexts. Note, however, that for PowerPC threads, the Thread Manager always saves the FPU registers regardless of how you set this option. Because the PowerPC microprocessor uses the FPU registers for optimizations, they could contain necessary information.

kExactMatchThread

Allocate a thread from the pool only if it exactly matches the stack-size request. Without this option, a thread is allocated that best fits the requestóthat is, a thread whose stack is greater than or equal to the requested size.

When you create or allocate a new thread with the NewThread function, you can specify thread options that define certain characteristics of the thread, using the values described here. To specify more than one option, you sum them together and pass them as a single parameter to the NewThread function.

The ThreadOptions data type defines the thread options.


© 2000 Apple Computer, Inc. — (Last Updated 3/8/2000)